﻿@{
    Layout = null;
    var lst = ViewData["lstmes"] as List<SmallJob.Model.MConversation>;
    var userid = (int)ViewData["curuserid"];
}
<div class="wrapper-conversations">
    @foreach (var item in lst)
    {
        var client = (item.Person1ID == userid ? item.User2 : item.User1);
        <a class="conversation-item" id="Cvs-@item.ShortID" onclick="loadCvs(this);" href="#">
              <input type="hidden" value="@item.Type"  class="hidden-type-cvs"/>
            <div class="conversation-item-inner">
                <div class="sender-avatar pull-left" title="Thăm trang cá nhân người này.">

                    <img src="@(string.IsNullOrWhiteSpace(client.Avatar) ? Url.Content("~/Content/img/blank-avatar.jpg") : client.Avatar)?w=64&h=64&q=90&format=jpg&mode=crop" />
                </div>
                <div class="inbox-body">
                    <p class="inbox-meta">
                        <span class="inbox-sender">@client.Name</span>
                        <span class="inbox-date">@string.Format("{0:m}", item.Message.Date)</span>
                    </p>
                    <p class="inbox-title">
                        @(item.Request == null ? (item.Provide == null ? "Private" : item.Provide.Title) : item.Request.Title)
                    </p>
                </div>
            </div>
        </a>
    }
</div>
@if (ViewData["nextpage"] != null)
{
    <a data-nextpage="@ViewData["nextpage"]" id="new-next-page"></a>
}